import React from 'react';

type Props = {
  repeatCount?: number;
  className?: string;
  children: React.ReactNode;
  style?: React.CSSProperties;
};

function TextSwiper({
  repeatCount = 5,
  children,
  className = '',
  style = {},
}: Props) {
  return (
    <div className={'text-swiper-wrap ' + className} style={style}>
      <div className="text-swiper-view">
        <div className="text-swiper-content">
          {Array.from({ length: repeatCount }).map((_, i) => {
            // eslint-disable-next-line react/no-array-index-key
            return (
              <div key={i} className="text-swiper-item">
                {children}
              </div>
            );
          })}
        </div>
      </div>
    </div>
  );
}

export default TextSwiper;
